package com.itcast.activiti.service;

import com.itcast.activiti.domain.StartProcessInstance;
import com.itcast.activiti.utils.ActivitiPage;
import org.activiti.engine.runtime.Execution;
import org.activiti.engine.runtime.ProcessInstance;

import java.util.Map;
import java.util.Set;

public interface IProcessRuntimeService {
    /**
     * 校验流程审批人
     *
     * @param startProcessInstance
     * @return
     */
    Boolean checkApprove(StartProcessInstance startProcessInstance);

    // 启动流程实例
    Map<String, Object> startProcessInstance(StartProcessInstance startProcessInstance);

    // 发起审批流程实例
    Map<String, Object> startProcessApply(StartProcessInstance startProcessInstance);

    // 获取流程实例
    ProcessInstance getProcessInstanceByBusinessKey(String businessKey, String tenantId);

    // 获取流程实例
    Map<String, Object> startProcessInstanceResultMap(ProcessInstance processInstance);

    // 获取流程实例
    ProcessInstance getProcessInstanceByProcessInstanceId(String processInstanceId);

    // 获取流程实例
    ActivitiPage listProcessInstancePage(ActivitiPage activitiPage);

    // 获取业务key集合
    Set<String> getBusinessKeys(Set<String> processInstanceIds);

    // 流程挂起
    Map<String, Object> processSuspend(String businessKey, String tenantId);

    // 流程激活
    Map<String, Object> processActivate(String businessKey, String tenantId);

    // 获取当前节点
    Execution getExecution(String executionId);

    ActivitiPage tasks(ActivitiPage activitiPage);

    // 获取流程实例参与用户
    Set<String> assignees(String businessKey, String tenantId);
}
